package service

import (
	"TD-UI/internal/model"
	"context"
)

type (
	ILink interface {
		Link(ctx context.Context, req model.LinkReq) (res model.LinkRes, err error)
		Add(ctx context.Context, req model.LinkAddReq) (res model.LinkRes, err error)
		GetAll(ctx context.Context, req model.LinkGetReq) (res model.LinkRes, err error)
		Del(ctx context.Context, req model.LinkDelReq) (err error)
	}
)

var (
	localLink ILink
)

func Link() ILink {
	if localLink == nil {
		panic("implement not found for interface ILink, forgot register?")
	}
	return localLink
}

func RegisterLink(i ILink) {
	localLink = i
}
